﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;

namespace XLDL.Includes
{
    public partial class QC_Trai : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
               QC();
            }
        }
        protected void QC()
        {
            // QC Trai
            StringBuilder str = new StringBuilder();
            string path = System.Configuration.ConfigurationManager.AppSettings["Images_Path"];
            DataTable tb = new DataTable();
            tb = XLDL.XLDaTa("select * from V_QC_Trai ORDER BY Ngay_Dang DESC");
          //  str.Append("<table width='100%'>");
            for (int i = 0; i < tb.Rows.Count; i++)
            {
                // str.Append("<tr>");
                //  str.Append("<td align='right'>");
                if (tb.Rows[i]["link"].ToString() == "")
                {
                    str.Append("<img src='" + path + tb.Rows[i]["hinh_anh"].ToString() + "' border='0' width='130px'  alt='' rel='' style='padding-top:1px'/>");

                }
                else
                {
                    str.Append("<a href='" + tb.Rows[i]["link"].ToString() + "' target='_blank' ><img src='" + path + tb.Rows[i]["hinh_anh"].ToString() + "' border='0' width='130px' height='500px' alt='' rel='' style='padding-top:1px'/></a>");

                }
                //str.Append("</td>");
                //str.Append("</tr>");
            }
            //str.Append("</table>");

            lbl_qc_trai.Text = str.ToString();

           
        }
    }
}